﻿using System;

namespace diantou.dataModel
{
    /// <summary>
    /// 比赛
    /// </summary>
    [fastCSharp.emit.jsonSerialize(IsAllMember = true)]
    [fastCSharp.emit.jsonParse(IsAllMember = true)]
    [fastCSharp.emit.dataSerialize(IsReferenceMember = false)]
    [fastCSharp.code.cSharp.webView.clientType(Name = "diantou.contest")]
    [fastCSharp.code.cSharp.sqlModel(LogTcpCallService = "DataLog")]
    public partial class contest
    {
        /// <summary>
        /// 问题标识
        /// </summary>
        [fastCSharp.code.cSharp.webView.outputAjax]
        public int Id;
        /// <summary>
        /// 用户标识
        /// </summary>
        public int UserId;
        /// <summary>
        /// 标题
        /// </summary>
        [fastCSharp.emit.dataMember(MaxStringLength = 256)]
        public string Title;
        /// <summary>
        /// 起始时间
        /// </summary>
        public DateTime StartTime;
        /// <summary>
        /// 结束时间
        /// </summary>
        public DateTime EndTime;
        /// <summary>
        /// 企业内部比赛随机验证编码
        /// </summary>
        public ulong RandomCode;
        /// <summary>
        /// 问题标识
        /// </summary>
        public int QuestionId;
        /// <summary>
        /// 比赛类型
        /// </summary>
        public enum type : byte
        {
            All,
            /// <summary>
            /// 正常比赛
            /// </summary>
            Contest,
            /// <summary>
            /// 复赛
            /// </summary>
            Rematch,
            /// <summary>
            /// 测试赛
            /// </summary>
            Test,
            /// <summary>
            /// 用户比赛
            /// </summary>
            User,
            /// <summary>
            /// 第三方比赛
            /// </summary>
            External,
            /// <summary>
            /// 企业内部比赛
            /// </summary>
            RandomCode,
        }
        /// <summary>
        /// 比赛类型
        /// </summary>
        public type Type;
        /// <summary>
        /// 是否发布显示
        /// </summary>
        public bool IsShow;
        /// <summary>
        /// 是否确定提交
        /// </summary>
        public bool IsSubmit;
        /// <summary>
        /// 是否需要填写注册信息
        /// </summary>
        public bool IsRegister;
        /// <summary>
        /// 是否忽略HTML格式化描述内容
        /// </summary>
        public bool IsIgnoreFormatDescription;

        /// <summary>
        /// 描述
        /// </summary>
        [fastCSharp.emit.dataMember(MaxStringLength = 64 << 10)]
        public string Description = string.Empty;

        /// <summary>
        /// 题目数量
        /// </summary>
        [fastCSharp.emit.dataMember(IsIgnoreCurrent = true, IsSqlStream = true)]
        public int ProblemCount;
        /// <summary>
        /// 提交用户数量
        /// </summary>
        [fastCSharp.emit.dataMember(IsIgnoreCurrent = true, IsSqlStream = true)]
        public int JudgeUserCount;
        /// <summary>
        /// 注册用户数量
        /// </summary>
        [fastCSharp.emit.dataMember(IsIgnoreCurrent = true, IsSqlStream = true)]
        public int UserCount;
    }
}
